
public class Main {
    public static void main(String[] args)
    {
        intface2 ak=new intface2(10,20);
        intface1 aj=new intface2(100,200);
        intface3 ae=new intface3(8);
        intface1 ad=new intface3(90);
        System.out.println("intface2 a="+ak.getA()+" b="+ak.getB()+" "+ak.k());
        System.out.println("intface1 "+aj.k());
        System.out.println("intface3 a="+ae.getA()+" "+ae.k());
        System.out.println("intface1 "+ad.k());
        ak=(intface2) aj;
        System.out.println("intface2 a="+ak.getA()+" b="+ak.getB()+" "+ak.k());
        ae=(intface3) ad;
        System.out.println("intface3 a="+ae.getA()+" "+ae.k());
    }
}
class intface3 implements intface1{
    private int a;
    public String k() {
        System.out.println("失败");
        return "NO";
    }
    public intface3(int a)
    {
        this.a=a;
    }

    public int getA() {
        return a;
    }
}

class intface2 implements intface1 {
    private int a;
    private int b;
    public String k() {
        System.out.println("成功");
        return "YES";
    }
    public intface2(int a,int b)
    {
        this.a=a;
        this.b=b;
    }

    public int getA() {
        return a;
    }

    public int getB() {
        return b;
    }
}

interface intface1 {
     String k();
}